home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
- <stack>
- <name>in</name>
- <id>-1</id>
- <cardCount>1</cardCount>
- <cardID>3851</cardID>
- <listID>3359</listID>
- <cantModify><false /></cantModify>
- <cantDelete><false /></cantDelete>
- <cantAbort><false /></cantAbort>
- <cardSize>
- <width>512</width>
- <height>342</height>
- </cardSize>
- <script>
- --Copyright © 1990 MacTutor
-
- --Written by Carl J. Manaster
- --August, 1990
-
- --message split
- --syntax: split(orientation,topMessage,bottomMessage)
- ----------where: orientation is "/" or "\"
- ----------topMessage is message to be called if click
- --------------------------was in top half of target
- ----------bottomMessage is message to be called if click
- --------------------------was in bottom half of target
-
- on split
- put param(2) into topMessage
- put param(3) into bottomMessage
- put (the bottom of the target) - (the clickV) into vDiff
- if param(1) is "/"
- then put (the clickH) - (the left of the target) into hDiff
- else put (the right of the target) - (the clickH) into hDiff
- put vDiff*(the width of the target)>hDiff*(the height of the target) into doTop
-
- if doTop
- then send topMessage to target
- else send bottomMessage to target
-
- end split
- ---------------------------------------------------------------------
-
-
- --message makePolyButton
- --syntax: makePolyButton(inMessage,outMessage)
- ----------inMessage is message to be called by clicks
- --------------------------within the polyButton
- ----------outMessage is message to be called by clicks
- --------------------------outside the polyButton
-
- on makePolyButton inMessage,outMessage
- put empty into pointList
- choose line tool
- set the cursor to cross
- wait until the mouseClick
- put the clickLoc into pointList
-
- repeat
- wait until the mouseClick
- put return & the clickLoc after pointList
- put the number of lines of pointList into count
- drag from (line count-1 of pointList) to (line count of pointList)
- if abs(item 1 of last line of pointList - item 1 of first line of pointList)<2¬
- and abs(item 2 of last line of pointList - item 2 of first line of pointList)<2 then exit repeat
- end repeat
-
- put line 1 of pointList into last line of pointList
- put the number of card buttons into cbCount
- set lockScreen to true
- doMenu revert
- choose button tool
-
- put item 1 of line 1 of pointList into maxV
- put item 1 of line 2 of pointList into maxPenV
- put item 1 of line 1 of pointList into minV
- put item 1 of line 2 of pointList into minPenV
-
- put item 2 of line 1 of pointList into maxH
- put item 2 of line 2 of pointList into maxPenH
- put item 2 of line 1 of pointList into minH
- put item 2 of line 2 of pointList into minPenH
-
- repeat with i=2 to count
-
- get item 1 of line i of pointList
- if it > maxPenV then --find the largest
- if it > maxV then --and second largest v
- put maxV into maxPenV
- put it into maxV
- else
- put it into maxPenV
- end if
- end if
-
- if it < minPenV then --find the smallest
- if it < minV then --and second smallest v
- put minV into minPenV
- put it into minV
- else
- put it into minPenV
- end if
- end if
-
- get item 2 of line i of pointList
- if it > maxPenH then --find the largest
- if it > maxH then --and second largest h
- put maxH into maxPenH
- put it into maxH
- else
- put it into maxPenH
- end if
- end if
-
- if it < minPenH then --find the smallest
- if it < minH then --and second smallest h
- put minH into minPenH
- put it into minH
- else
- put it into minPenH
- end if
- end if
-
- end repeat
-
- add 1 to cbCount --create the interior button
- doMenu "new button"
- set the style of card button cbCount to transparent
- set the showName of card button cbCount to false
- set the autoHilite of card button cbCount to false
- set the rect of card button cbCount to minPenV,minPenH,maxPenV,maxPenH
- put "on mouseUp" into theScript
- put return & inMessage after theScript
- put return & "end mouseUp" after theScript
- set the script of card button cbCount to theScript
-
- repeat with i=1 to count-1
- add 1 to cbCount --create the